<?php
namespace app\index\controller;

use app\admin\model\CategoryList;
use app\admin\model\CommonInfo;
use app\admin\model\DesignerList;
use app\admin\model\LeaveWord;
use app\admin\model\ListsList;
use app\admin\model\LunboList;
use app\admin\model\NewsList;
use app\admin\model\ProcessList;
use think\Controller;

class Index extends Base
{
    public function index()
    {
        $cate = CategoryList::where('id',2)->find();
        $lunbo = LunboList::where('category_id',2)->order('sort desc')->select();
        $foot = CommonInfo::where('id',1)->find();
        $news = CategoryList::where('id',12)->find();
        $lists = CategoryList::where('id',10)->find();
        $designer = CategoryList::where('id',13)->find();
        $news['list'] = NewsList::where('is_home',1)->limit(8)->select();
        $lists['list'] = ListsList::where('is_home',1)->limit(4)->select();
        $designer['list'] = DesignerList::where('is_home',1)->limit(4)->select();
        $process = array_chunk(ProcessList::select()->toArray(),3);
        $this->assign('process',$process);
        $this->assign('lists',$lists);
        $this->assign('news',$news);
        $this->assign('designer',$designer);
        $this->assign('cate_id',$cate);
        $this->assign('lunbo',$lunbo);
        $this->assign('common',$foot);
        return $this->fetch();
    }






}
